<?php
namespace app\admin\model;

class Activity extends BaseModel
{
    public function listTimeInfo($list)
    {
        if (count($list['data']) > 0) {


            foreach ($list['data'] as $k=>$v){
                $list['data'][$k]['addtime'] = date('Y-m-d',$v['addtime']);
                if ($v['start_time'] > 0) {
                    $list['data'][$k]['start_time'] = date('Y-m-d', $v['start_time']);
                }
                if ($v['end_time'] > 0) {
                    $list['data'][$k]['end_time'] = date('Y-m-d', $v['end_time']);
                } else {
                    $list['data'][$k]['end_time'] = '无期限';
                }
            }
            
            return $list;
        }
    }
}
